package com.boot.unity.api.modules.training.controller;

import com.boot.unity.api.common.Result;
import com.boot.unity.api.modules.training.dao.StageTrainingTimeDao;
import com.boot.unity.api.modules.training.entity.StageTrainingTime;
import com.boot.unity.api.modules.training.service.StageTrainingTimeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@Api(tags = "驾校-阶段培训记录")
//@RestController
//@RequestMapping("/api/stagetrainingtime")
@AllArgsConstructor
public class StageTrainingTimeController {
    private final StageTrainingTimeDao stageTrainingTimeDao;
    private final StageTrainingTimeService stageTrainingTimeService;

    @ApiOperation(value = "阶段培训记录上报")
    @PostMapping
    public Result save(@RequestBody StageTrainingTime stageTrainingTime) {
        return stageTrainingTimeService.save(stageTrainingTime);
    }

//    @GetMapping("/{id}")
//    @ApiOperation(value = "根据id获取")
//    public StageTrainingTime get(@PathVariable Long id) {
//        return stageTrainingTimeDao.getById(id);
//    }
//
//    @PutMapping
//    @ApiOperation(value = "修改")
//    public StageTrainingTime update(@RequestBody StageTrainingTime stageTrainingTime) {
//        stageTrainingTimeDao.update(stageTrainingTime);
//
//        return stageTrainingTime;
//    }
//
//    @GetMapping
//    @ApiOperation(value = "列表")
//    public PageTableResponse list(PageTableRequest tableRequest) {
//        return new PageTableHandler(
//            request -> stageTrainingTimeDao.count(request.getParams()),
//            request -> stageTrainingTimeDao.list(request.getParams(), request.getOffset(), request.getLimit())
//        ).handle(tableRequest);
//    }
//
//    @DeleteMapping("/{id}")
//    @ApiOperation(value = "删除")
//    public void delete(@PathVariable Long id) {
//        stageTrainingTimeDao.delete(id);
//    }
}
